//
// Created by xili on 2024/8/21 21:27.
// GO BIG OR GO HOME.
//
#include "leetcode.h"

#define sz(a) a.size()

class Solution {
public:
    int xorAllNums(vector<int> &nums1, vector<int> &nums2) {
        int a = 0, b = 0, m = sz(nums1), n = sz(nums2);
        for (int &v: nums2)b ^= v;
        for (int &v: nums1)a ^= v;
        if (n % 2 == 0)a = 0;
        if (m % 2 == 0)b = 0;
        return a ^ b;
    }
};
